const request = require('../../utils/Interface.js')

// 添加
export function deviceInsert(data) {
  return request.doRequest(
    '/miewen/mini/device/insert',
    'POST',
    data
  )
}

// 移除
export function deviceDelete(data) {
  return request.doRequest(
    '/miewen/mini/device/delete',
    'GET',
    data
  )
}

// 修改
export function deviceUpdate(data) {
  return request.doRequest(
    '/miewen/mini/device/update',
    'POST',
    data
  )
}

// 查询
export function deviceFindAll(data) {
  return request.doRequest(
    '/miewen/mini/device/findAll',
    'GET',
    data
  )
}

// 查询
export function deviceFind(data) {
  return request.doRequest(
    '/miewen/mini/device/findInfo',
    'GET',
    data
  )
}

// 给人员绑定设备
export function userBindDevice(data) {
  return request.doRequest(
    '/miewen/mini/device/userBindDevice',
    'POST',
    data
  )
}

// 刷新设备信息
export function refresh(data) {
  return request.doRequest(
    '/miewen/mini/device/refresh?uuid=' + data.uuid,
    'POST'
  )
}

// 远程开关
export function control(data) {
  return request.doRequest(
    '/miewen/mini/device/control',
    'GET',
    data
  )
}

// 设备定时
export function timeSet(data) {
  return request.doRequest(
    '/miewen/mini/device/timeSet',
    'POST',
    data
  )
}

export function getState(data) {
  return request.doRequest(
    '/miewen/mini/tool/state',
    'GET',
    data
  )
}

export function cameraControl(data) {
  return request.doRequest(
    '/miewen/mini/device/cameraControl',
    'GET',
    data
  )
}

// 获取灭虫数据记录
export function getTotalRecord(data) {
  return request.doRequest(
    '/miewen/mini/device/getTotalRecord',
    'GET',
    data
  )
}

// 获取灭虫实时数据
export function getCountRecord(data) {
  return request.doRequest(
    '/miewen/mini/device/getCountRecord',
    'POST',
    data
  )
}

// 恢复流
export function resumeLive(data) {
  return request.doRequest(
    '/miewen/mini/live/resumeLive',
    'GET',
    data
  )
}

// 断流
export function dropLive(data) {
  return request.doRequest(
    '/miewen/mini/live/dropLive',
    'GET',
    data
  )
}

// 查询流状态
export function describeLiveStreamState(data) {
  return request.doRequest(
    '/miewen/mini/live/describeLiveStreamState',
    'GET',
    data
  )
}

// 禁推直播流
export function forbidLive(data) {
  return request.doRequest(
    '/miewen/mini/live/forbidLive',
    'GET',
    data
  )
}